package com.android.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.android.apis.entity.Title;
import com.android.service.TitleService;
import com.google.gson.Gson;

@Controller
public class TitleController {
	@Autowired
	public TitleService titleService;
	@ResponseBody
	@RequestMapping(value="/getTitle",produces = "text/json;charset=UTF-8")
	public String selectAll() {
		List<Title> list = titleService.selectAll();
		//System.out.println(list);
		Gson gson=new Gson();
		String gson1=gson.toJson(list);
		return gson1;
	}
}
